package com.jn.exam.exam.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jn.exam.exam.entity.Exam;
import com.jn.exam.exam.entity.Student;
import com.jn.exam.exam.entity.Teacher;
import com.jn.exam.exam.entity.vo.ExamStudentVo;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 江南大学1033190417
 * @since 2022-02-18
 */
public interface ExamService extends IService<Exam> {

    boolean registerForExam(Map<String, Object> param);

    //拿到学生参加考试的id
    List<String> getStudentExamIds(String studentId);

    List<Student> getAllStudentForExam(String examId);

    boolean saveExam(Exam exam);

    //添加监考老师
    boolean addExamProctor(Map<String, Object> param);

    //添加阅卷老师
    boolean addExamMarking(Map<String, Object> param);

    //移除监考老师
    boolean removeProctor(String examId, String teacherId);

    //移除阅卷老师
    boolean removeMarking(String examId, String teacherId);

    //删除考试
    boolean deleteExam(String examId);

    //试卷管理者查询试卷
    List<String> getExamIds(String teacherId);

    //考生放弃某考试
    boolean leaveExam(String studentId, String examId);

    //查看我的监考
    List<String> getMyProctorExamIds(String teacherId);

    //查询我的阅卷
    List<String> getMyMarkingExamIds(String teacherId);

    //查询某场考试的监考老师
    List<Teacher> getProctorTeacher(String examId);

    //查询某考试的阅卷老师
    List<Teacher> getMarkingTeacher(String examId);

    //按条件查询参加某考试的学生总数
    Integer getPageStudentForExamTotal(ExamStudentVo examStudentVo);

    //按条件查询参加某考试的学生信息
    List<Student> getPageStudentForExam(ExamStudentVo examStudentVo);

    //获取学生参加某场考试的状态
    Integer isAttendedForExam(String examId, String studentId);

    //学生点击确认考试触发事件
    boolean updateAttendFormExam(String examId, String studentId,Integer status);

    //认定某学生作弊
    boolean cheatStudent(String examId, String studentId,boolean isCheated);

    //拿到某场考试的所有学生的在线情况
    List<Map<String, Object>> getAllStudentAttendStatusOfExam(String examId);

    //查询考试每个分数的人数
    List<Map<String, Object>> queryNumberOfPerScore(String examId);
}
